import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:jetour_line/utils/extension_int.dart';
import '../my_colors.dart';
void showMPermissionDialog(BuildContext context, int type) {
  String? title,msg;
  if(type == 1){
    title = '位置权限说明';
    msg = '位置权限仅用于发布动态、选择/查看经销商、查看附近权益或服务等需要定位权限的功能。';
  }else  if(type == 2){
    title = '相机权限说明';
    msg = '相机权限仅用于扫一扫、发布动态、商城晒图、用户聊天等需要拍摄照片或视频的功能。';
  }else  if(type == 3){
    title = '相册权限说明';
    msg = '相册权限仅用于发布动态、商城晒图、用户聊天等需要获取图片或视频的功能。';
  }else  if(type == 4){
    title = '麦克风权限说明';
    msg = '麦克风权限仅用于仅用于用户聊天、发布动态、权益打卡等需要录制音频的功能';
  }
  showDialog<Null>(
    barrierColor: Colors.transparent,
    context:  context,
    barrierDismissible: false, //点击背景是否可以退出
    builder: (BuildContext context) {
      return Column(
        children: [
          Padding(
            padding: EdgeInsets.all(20.px),
            child: ClipRRect(
              borderRadius: BorderRadius.all(Radius.circular(20.px)),
              child: Container(
                width: double.infinity,
                color:MyColors.white,
                child: Padding(
                  padding: EdgeInsets.all(20.px),
                  child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
                    Text(title!,style: TextStyle(fontSize: 30.px,color: MyColors.color333333,decoration: TextDecoration.none),),
                    SizedBox(height: 20.px,),
                    Text(msg!,style: TextStyle(fontSize: 30.px,color: MyColors.color666666,decoration: TextDecoration.none),),
                  ],),
                ),
              ),
            ),
          ),
        ],
      );
    },
  );
  return;

}
